<template>
	<view>
		<web-view :src="orderData.payurl"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
					orderData:{},
					timer:null
			}
		},
		onLoad() {
			this.orderData = uni.getStorageSync('orderKey');
			const self =this
			console.log()
			//this.timer = setInterval(function(){
			  // this.orderStatus(this.orderData.order_sn,this.orderData.id)
			//}, 2000);
			
		},
		methods: {
			orderStatus(order_sn,id){
				
				this.$request('common.status', {
					order_sn,
					id
				}).then(res => {
					
					if(res.data==1){
						clearInterval(this.timer); 
						this.timer=null
						uni.showToast({
						    title: '支付成功',
							icon: 'none',
							duration: 2000
						});
			
						
						// uni.$emit('updateUserInfo', true)
						uni.hideLoading()
						uni.switchTab({
							url: '/pages/home/user'
						});
					}
					
				})
			},
		}
	}
</script>

<style>

</style>
